package com.itheima.HOMEW;

public class student {
   /* 定义标准学生类，属性包括姓名和年龄，
    要求分别使用空参和有参构造方法创建对象，空参创建的对象通过setXxx赋值，
    有参创建的对象直接赋值，并通过show方法展示数据。
    */
     private String name;
     private int age;
     public  student(){

     }
     public student(String name ,int age){
         this.name = name;
         this.age = age;
     }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getAge() {
        return age;
    }
    public void show(){
        System.out.println(name + "..."+age);
    }


}
class StudentDemo {
    public static void main(String[] args) {
        student s1 = new student();
        s1.setName("李沁");
        s1.setAge(32);
        s1.show();

        student s2 = new student("李沁",32);
        s2.show();
    }
}
